﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Linq
{

    public static class ListExMethod
    {
        public static T RandomOne<T>(this IEnumerable<T> enumer)
        {
            if (enumer == null) return default(T);
            var count = enumer.Count();
            var r = new Random();
            var index = r.Next(0, count);
            return enumer.ElementAt(index);
        }
    }

}
